﻿{%include file="index.header.tpl.php"%}
{%include file="index.left.tpl.php"%}
  <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <section class="col-lg-12 connectedSortable">
         <div class="box box-default box-solid">
            
                <div class="box-header with-border">
                    <span class="fa fa-list" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
                    <p class="box-title">{%$grade_name%}{%$exam_name%}成绩列表（平均分）</p>
                </div>
                <div class="box-body">
				 <form name="form1" action="" method="get">
                         <div class="col-md-4 form-group log">
                              <label class="col-sm-5 control-label text-right">
                                   学期：
                              </label>
                              <div class="input-group col-sm-7 col-xs-12" >
                                      <select class="form-control" id="semester_id" name="semester_id">   
                                            <option value="0">-请选择-</option>  
											{%foreach from=$semester_lists key=key item=value%}
                                            <option value="{%$value.semester_id%}">{%$value.semester_name%}</option>
											{%/foreach%}
                                        </select> 
                              </div> 
                         </div>
                         <div class="col-md-4 form-group examine"> 
                              <label class="col-sm-5 control-label text-right">
                                   考试名称：
                              </label>
                              <div class="input-group col-sm-7 col-xs-12" >
                                      <select class="form-control" id="exam_name" name="exam_id">  
                                            <option value="0">-请选择-</option>  
                                        </select>  
                              </div> 
                         </div>
                        <div class="col-md-4 form-group">
                              <label class="col-sm-3 control-label text-right">
                                   年级：
                              </label>
                              <div class="input-group col-sm-4 col-xs-12" style="float:left; margin-right:12px;">
                                     <select class="form-control" name="grade_id">
											{%foreach from=$grade_lists key=key item=value%}
                                            <option value="{%$value.grade_id%}">{%$value.grade_name%}</option>
											{%/foreach%}
                                     </select>
                              </div> 
							  <input type="hidden" name="a" value="score.gradelist">
                              <button type="submit" class="btn btn-primary"> 搜 索</button>
                        </div>
                      </form>
                      <div style="width:100%; overflow-x:scroll;">
                       <table class="table table-bordered table-striped"  id="mytable">
                              <thead>
                                    <tr style="background-color:#fcb53f;">
                                        <td>班级名称</td>
										{%foreach from=$data_lists.1.vscore key=key item=value%}
										<td>{%$key%}</td>
										{%/foreach%}
										<td>总分</td>

										<td>班级总分平均排名</td>
                                    </tr>
                            </thead>	
							{%foreach from=$data_lists key=key item=value%}
                                    <tr>
                                        <td>{%$value.class_name%}</td>
										{%foreach from=$value.vscore key=k item=v%}
										<td>{%$v%}</td>
										{%/foreach%}
										<td>{%$value.total%}</td>
										<td>{%$value.class_rank%}</td>
                                    </tr>	
							{%/foreach%}
                        </table> 
                    </div> 
				</div><!--box-body -->
                <div class="box-footer" >        
                     
                </div>

           </div><!--box box-default box-solid-->
         </section>   
        </div><!--row-->
    </section>
 </div>
  <!--主要内容结束-->
{%include file="index.footer.tpl.php"%}
 <!--二级联动-->
  <script type="text/javascript">
        $(document).ready(function () {
             $("#semester_id").change(function () {		
                 if ($(this).val() == "-1") {
					$("#industr").remove(); return; 
					}
                else {
			var timestamp = new Date().getTime();
			$.ajax({
			url:"index.php?a=exam.listBySemesterJson",
			type:"get",
			data: "semester_id=" + $("#semester_id").find("option:selected").val() + "&timestamp=" + timestamp,
			dataType:"json",
			success:function(msg){
                             var industr = "";
                             $.each(msg, function (n, v) {
                                industr += ("<option value=\"" + n + "\">" + v);
                                industr += ("</option>");
                            });
                             $("#exam_name").html(industr);			   			   
			}
			});					
                 }

            });

        });
</script>
       
